package com.atguigu.eduservice.controller;

import com.atguigu.commonutils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @Author hg
 * @CreatedTime 2020-10-04-14:59
 */
@RestController
@RequestMapping("/eduservice/user")
@CrossOrigin
public class EduLoginController {

    @ApiOperation("登录")
    @PostMapping("login")
    public R login() {
        return R.ok().data("token","admin");
    }

    @ApiOperation("获取信息")
    @GetMapping("info")
    public R info() {
        return R.ok()
                .data("roles","[admin]")
                .data("name","admin")
                .data("avatar","http://img.touxiangwu.com/2020/3/iAR3Ib.jpg");
    }
}
